package ${cfg.basePackage}.module.${cfg.modulePackage}.controller;

import ${cfg.basePackage}.module.${cfg.modulePackage}.service.${cfg.modulePackageUp}${entity}Service;
import ${cfg.basePackage}.mybatis.entity.${entity};
import com.mi.rule.security.resource.Res;
import com.mi.rule.security.resource.ResApi;
import com.mi.rule.util.project.SRS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Res("${cfg.moduleName}")
@RestController
@RequestMapping("/${cfg.modulePackage}/${table.entityPath}")
public class ${cfg.modulePackageUp}${entity}Controller {
    @Autowired
    private ${cfg.modulePackageUp}${entity}Service ${cfg.modulePackage}${entity}service;

    @ResApi("新增")
    @RequestMapping("/insert")
    public SRS insert(@RequestBody ${entity} param) {
        return ${cfg.modulePackage}${entity}service.insert(param);
    }

    @ResApi("删除")
    @RequestMapping({"/delete"})
    public SRS delete(@RequestBody Long[] ids) {
        return ${cfg.modulePackage}${entity}service.delete(ids);
    }

    @ResApi("修改")
    @RequestMapping("/update")
    public SRS update(@RequestBody ${entity} param) {
        return ${cfg.modulePackage}${entity}service.update(param);
    }

    @ResApi("详情")
    @RequestMapping("/info")
    public SRS one(@RequestBody SRS param) {
        return ${cfg.modulePackage}${entity}service.info(param);
    }

    @ResApi("分页")
    @RequestMapping("/page")
    public SRS page(@RequestBody SRS param) {
        return ${cfg.modulePackage}${entity}service.page(param);
    }

    @ResApi("列表")
    @RequestMapping("/list")
    public SRS list(@RequestBody SRS param) {
        return ${cfg.modulePackage}${entity}service.list(param);
    }

}
